package com.hz.ys_production.action;


import com.hz.framework.MyAction.BaseAction;
import com.hz.framework.dao.CommonDao;
import com.hz.ys_financial.dao.FinancialDao;
import com.hz.ys_production.bean.PresDailypaper;
import com.hz.ys_production.dao.DailyPaperDao;

/**
 * *****************************************************************************
 *               Copyright(c) 2010 by 哈尔滨华泽数码科技有限公司.
 *                       All rights reserved.
 *******************************************************************************
 *     File Name         :  com.hz.ys_stock.action.MakingsManageAction.java
 *     Description(说明)	: 生产日报 action
 * -----------------------------------------------------------------------------
 *     No.        Date              Revised by           Description	
 *     			  Jul 29, 2011           韩飞              Created
 *****************************************************************************
 */
public class DailyPaperAction extends BaseAction {

	private static final long serialVersionUID = 1L;
	
	private Object pagList = null;
	private PresDailypaper mak = new PresDailypaper();
	

	/**
	 * @author 韩飞
	 * @time Nov 19, 2011	
	 * @return
	 * @throws Exception 
	 * 方法功能: 生产日报
	 */
	public String DailyPaper() throws Exception {
		boolean selflag = true;
		boolean pagflag = false;
		String rn = "";
		DailyPaperDao sd = new DailyPaperDao();
		String operate = CommonDao.isnull(request.getParameter("operate"));
//		录入页面进入
		if("inspage".equals(operate)){
//			查询人员信息
			request.setAttribute("personlist", new FinancialDao().SelPerson());
			String taskid = CommonDao.isnull(request.getParameter("taskid"));
			request.setAttribute("taskinfo", sd.SelTaskInfo(taskid));
			
			rn = "inspage";
			selflag = false;
		}
//		保存信息
		if("insinfo".equals(operate)){
			
			request.setAttribute("msg", sd.DoSaveDailyPaper(mak));
			rn = "inspage";
			selflag = false;
		}
//		修改页面进入
		if("updpage".equals(operate)){
//			查询人员信息
			request.setAttribute("personlist", new FinancialDao().SelPerson());
			//查询供应商信息 放到页面中
			request.setAttribute("updinfo", sd.SelDailypaper_info(request));
			rn = "updpage";
			selflag = false;
		}
//		修改信息
		if("updinfo".equals(operate)){
			request.setAttribute("msg", sd.UpdDailypaper(mak));
			rn = "inspage";
			selflag = false;
		}
//		查看详细进入
		if("selpage".equals(operate)){
			request.setAttribute("updinfo", sd.SelDailypaper_info(request));
			rn = "selpage";
			selflag = false;
		}
//		删除信息
		if("delinfo".equals(operate)){
			sd.Del_DailyPaper(request);
			rn = "rect";
			selflag = false;
		}
//		默认列表页面
		if(selflag){
			rn = SUCCESS;
			pagList = sd.SelDailypaper(request);
			pagflag = true;
		}
//		配置分页
		if(pagflag){
			doAllSearchList(request, "listinfo", pagList, "jdbc");
		}
		
		return rn;
	}


	public PresDailypaper getMak() {
		return mak;
	}


	public void setMak(PresDailypaper mak) {
		this.mak = mak;
	}
	
	
	
}
